#coding=utf-8
"""
Author:林怡
Time:2025/5/6 17:53
"""

'''
此模块是用来读取Excel表格的工具类
在dos窗口：pip install xlrd==1.2.0
'''
import sys
sys.path.append('..')
import xlrd
from config.config import *
import os

class Read_Excel(object):
    def __init__(self,filename,sheet_Name):
        # 打开一个Excel表格
        self.workbook = xlrd.open_workbook(filename)
        # 进入指定的sheet页面
        self.sheetName = self.workbook.sheet_by_name(sheet_Name)

    def get_excel_data(self,row,col):
        '''封装了一个通过行和列来获取Excel表格里的内容的工具方法'''
        value = self.sheetName.cell(row,col).value
        return value
file = os.path.join(data_path,'data.xls')
excel = Read_Excel(file,"data")
url = excel.get_excel_data(1,0)
print(url)













